package com.vishop.services;

import java.util.Collection;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import com.vishop.daos.ProductDaoImpl;
import com.vishop.models.Product;

@Service
public class ProductServiceImpl implements ProductService {
 
    @Autowired
    private ProductDaoImpl productDAO;
     
    @Transactional
    public Product getById(int id){
    	return productDAO.getById(id);
    } 
    
    @Transactional
    public Collection<Product> zoekProducten(String naam){
    	return productDAO.zoekProducten(naam);	
    }
    
    @Transactional
    public Collection<Product> getAllProduct(){
		return productDAO.getAllProduct();
	}
    
    @Transactional
    public Collection<Product> getHerenProducten(){
		return productDAO.getHerenProducten();
	}
    
    @Transactional
    public Collection<Product> getDamesProducten(){
		return productDAO.getDamesProducten();
	}
    
    @Transactional
    public Collection<Product> getProductByMerk(int id){
		return productDAO.getProductByMerk(id);
	}
    
    @Transactional
    public int save(Product product){
   		return productDAO.save(product);
   	}
    
    @Transactional
    public void update(Product product){
    	productDAO.update(product);
    }
    
    @Transactional
    public void delete(int id){
    	productDAO.delete(id);
	}
}
